package boot

import (
	"fmt"
	"gfEasy/app/service/TaskInfoService"
	_ "gfEasy/packed"
	"github.com/gogf/gf"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/swagger"
	"runtime"
)

// 用于应用初始化。
func init() {
	fmt.Println(g.Cfg().GetString("server.appname"))
	fmt.Println("AppVersion:", g.Cfg().GetString("server.version"))
	fmt.Println("GoVersion:", runtime.Version())
	fmt.Println("GoFrame:", gf.VERSION)
	fmt.Println("OS:", runtime.GOOS+"-"+runtime.GOARCH)
	s := g.Server()
	s.Plugin(&swagger.Swagger{})
	//监听是否有新的redis事件
	go TaskInfoService.S.AddTaskSubscribe()
	//定时任务注册
	TaskInfoService.S.InitStartALLTaskList()
}
